﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using AutoMapper;
using ZeroSum.Domain.Dtos;
using ZeroSumZSA.Core.Aggregates.RoleAggregate;

namespace ZeroSumZSA.Application.ApplicationServices.Roles.Dto.In;

/// <summary>
///     角色添加模型
/// </summary>
[AutoMap(typeof(Role), ReverseMap = true)]
public class AddRoleDto : AddInputDto
{
    /// <summary>
    ///     获取或设置 角色名称
    /// </summary>
    [DisplayName("角色名称")]
    [Required(ErrorMessage = "角色名称不能为空")]
    [StringLength(20, MinimumLength = 3)]
    public string? Name { get; set; }

    /// <summary>
    ///     编码
    /// </summary>
    [Required(ErrorMessage = "角色编码不能为空")]
    [DisplayName("编码")]
    [StringLength(50, MinimumLength = 3)]
    public string? Code { get; set; }

    /// <summary>
    ///     排序
    /// </summary>
    [DisplayName("排序")]
    public int Sort { get; set; }

    /// <summary>
    ///     获取或设置 角色描述
    /// </summary>
    [StringLength(100)]
    [DisplayName("角色描述")]
    public string? Remark { get; set; }
}